<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class OrderItem extends Model
{
    protected $table = 'order_item';
	protected $guarded = [];

	protected $hidden = ["created_at","updated_at"];
	

	// 关联订单
	public function order(){
		return $this->hasOne(Order::class, 'id', 'order_id');
	}
	// 关联服务
	public function service(){
		return $this->belongsTo(StoreService::class,'service_id','id');
	}


	/**
	 * 一对多的关联
	 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
	 */
	public function orderMul(){
		return $this->belongsTo(Order::class,'id','order_id');
	}



	public function barber(){
		return $this->belongsTo(User::class,'barber_id','id');
	}

	public function assistant(){
		return $this->belongsTo(User::class,'assistant_id','id');
	}
}
